package com.hnevc.androidui3;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
    class MyOnClickListener implements View.OnClickListener{
        @Override
        public void onClick(View v) {
            Toast.makeText(MainActivity.this
                    , "登录失败！"
                    , Toast.LENGTH_SHORT).show();

        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.control_layout);
        Button btnLogin = findViewById(R.id.btn_login);//获取
        MyOnClickListener listener = new MyOnClickListener();//创建监听器对象
        btnLogin.setOnClickListener(listener);//为btnlogin设置监听器
    }


    public void click(View view) {
        Toast.makeText(this, "大骗子！！", Toast.LENGTH_SHORT).show();
    }
}
